package com.wwwzh.himalayafm.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;

/**
 * Created by weizz on 2016/12/2.
 * viewPager  适配器
 */

public class DisPagerAdapter extends FragmentPagerAdapter {

    private List<Fragment> fragmentList;
    private List<String> titleList;;
    public DisPagerAdapter(FragmentManager fm,List<Fragment> list,List<String>title) {
        super(fm);
        this.fragmentList = list;
        this.titleList =title;
    }

    @Override
    public Fragment getItem(int position) {
        return fragmentList.get(position);
    }

    @Override
    public int getCount() {
        return fragmentList.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return titleList.get(position);
    }
}
